import request from '@/utils/httpRequest'

export const getMenus = (data) => {
    return request({
        url: request.adornUrl('/product/category/list/tree'),
        method: 'get',
        params: request.adornParams(data)
    })
}


export const deletes = (data) => {
    return request({
        url: request.adornUrl('/product/category/delete'),
        method: 'post',
        data: request.adornData(data, false)
    })
}

export const add = (data) => {
    return request({
        url: request.adornUrl('/product/category/save'),
        method: 'post',
        data: request.adornData(data, false)
    })
}

export const get = (data) => {
    return request({
        url: request.adornUrl('/product/category/info/' + data),
        method: 'get',
        //params: request.adornParams(data)
    })
}
export const edit = (data) => {
    return request({
        url: request.adornUrl('/product/category/update'),
        method: 'post',
        data: request.adornData(data, false)
    })
}
export const updateSort = (data) => {
    return request({
        url: request.adornUrl('/product/category/update/sort'),
        method: 'post',
        data: request.adornData(data, false)
    })
}
export default {
    getMenus,
    deletes,
    add,
    get,
    edit,
    updateSort
}